
source('make_dataset.R')

df12r = open_dataset('df12_full.parquet')
df16r = open_dataset('df16_full.parquet')
df20r = open_dataset('df20_full.parquet')

out1 = df20r %>% filter(total > 0) %>% select(total, income_est) %>% collect()
out1 = out1[!is.na(income_est), as.list(quantile(total, c(0.05, 0.25, 0.5, 0.75, 0.95))), income_est]

out2 = df20r %>% filter(total > 0) %>% select(total, net_worth) %>% collect()
out2 = out2[!is.na(net_worth), as.list(quantile(total, c(0.05, 0.25, 0.5, 0.75, 0.95))), net_worth]

save(out1, out2, file = 'summary_data/figA3.rda')
